#include<ioCC2530.h>
#define LED1 P1_0
#define SW1 P1_2
void delay(unsigned int time){
  unsigned int i,j;
  for(i = 0;i<time;i++){
    for(j = 0;j<2048;j++);
  }
}
void initial_gpio(){
  P1SEL &=~0X05;
  P1DIR |=0X01;
  P1DIR &=~0X04;
  P1INP |=0X04;
  P2INP |=0X40;
  P1 &=~0X01;
}
void illumine_LED(void){
      if(SW1 ==0 ){
        LED1 =~LED1;
        while(!SW1);
      }
}
void main(void){
  initial_gpio();
  for(;;){
    illumine_LED();
  }
}